package com.amos.muexamclient.sys.controller;

import com.amos.bean.Result;
import com.amos.muexamclient.security.service.SysLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Copyright © 2018 嘉源锐信. All rights reserved.
 *
 * @Project: mu-exam
 * @ClassName: SysLoginController
 * @Package: com.amos.muexamclient.sys.controller
 * @author: zhuqb
 * @Description:
 * @date: 2020/3/24 0024 下午 14:37
 * @Version: V1.0
 */
@RestController
public class SysLoginController {
    @Autowired
    private SysLoginService loginService;

    /**
     * 登录
     *
     * @param username
     * @param password
     * @param code
     * @param uuid
     * @return
     */
    @PostMapping(value = "/login")
    public Result login(String username, String password, String code, String uuid) {
        return Result.success(loginService.login(username, password, code, uuid));
    }

    @GetMapping(value = "/getInfo")
    public Result getInfo() {
        return Result.success(loginService.getInfo());
    }

    @GetMapping("getRouters")
    public Result getRouters() {
        return Result.success(loginService.getRouters());
    }
}
